🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / core / model / src / commonMain / kotlin / org / meshtastic / core / model / NetworkDeviceLink.kt
Displaying Raw • Download
core/model/src/commonMain/kotlin/org/meshtastic/core/model/NetworkDeviceLink.kt 01cd54907d62cd90913d3d071b6bc240cae365ef (01cd5490) Text, 3.19 KB
T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.core.model
Tff7b72import T7ee787kotlinx.serialization.ExperimentalSerializationApi
Tff7b72import T7ee787kotlinx.serialization.Serializable
Tff7b72import T7ee787kotlinx.serialization.json.JsonIgnoreUnknownKeys
T8b949e/**
* Response envelope of `GET /resource/deviceLinks` on the Meshtastic API. The server resolves meshtastic/msh.to's
* catalog into fully-classified links (type + targets + regions), so the client only stores and filters them — no
* client-side matching heuristic.
*/
Tf0883e@Serializable
Tf0883e@OptInTb4b4b4(Te6edf3ExperimentalSerializationApiTff7b72::Te6edf3classTb4b4b4)
Tf0883e@JsonIgnoreUnknownKeys
Tff7b72data Tff7b72class T56d364NetworkDeviceLinksResponseTb4b4b4(
Tff7b72val Te6edf3versionTb4b4b4: Tffa657Int Tff7b72= T79c0ff1Tb4b4b4,
Tff7b72val Te6edf3generatedAtTb4b4b4: Tffa657String? Tff7b72= Tff7b72nullTb4b4b4,
Tff7b72val Te6edf3sourceTb4b4b4: Tffa657String? Tff7b72= Tff7b72nullTb4b4b4,
Tff7b72val Te6edf3linksTb4b4b4: Te6edf3ListTff7b72<Te6edf3NetworkDeviceLinkTff7b72> Tff7b72= Te6edf3emptyListTb4b4b4(Tb4b4b4)Tb4b4b4,
Tb4b4b4)
T8b949e/**
* A single resolved device link from the Meshtastic API.
*
* @param shortCode msh.to short code, e.g. `rokland-t-deck-plus`.
* @param url the user-facing `https://msh.to/<shortCode>` link (the retailer destination is intentionally not exposed).
* @param description human-readable label.
* @param type authoritative classification: [TYPE_INTERNAL], [TYPE_VENDOR], or [TYPE_MARKETPLACE].
* @param targets device `platformioTarget`s this link is attached to; `null` = untriaged, empty = device-agnostic.
* @param hwModels `hwModel` ints derived from [targets] server-side (parallel list).
* @param marketplace retailer key (e.g. `rokland`) for marketplace links, else `null`.
* @param regions ISO 3166-1 alpha-2 shipping regions; `null` = worldwide (no region filter).
*/
Tf0883e@Serializable
Tf0883e@OptInTb4b4b4(Te6edf3ExperimentalSerializationApiTff7b72::Te6edf3classTb4b4b4)
Tf0883e@JsonIgnoreUnknownKeys
Tff7b72data Tff7b72class T56d364NetworkDeviceLinkTb4b4b4(
Tff7b72val Te6edf3shortCodeTb4b4b4: Tffa657String Tff7b72= Ta5d6ff"Ta5d6ff"Tb4b4b4,
Tff7b72val Te6edf3urlTb4b4b4: Tffa657String Tff7b72= Ta5d6ff"Ta5d6ff"Tb4b4b4,
Tff7b72val Te6edf3descriptionTb4b4b4: Tffa657String? Tff7b72= Tff7b72nullTb4b4b4,
Tff7b72val Te6edf3typeTb4b4b4: Tffa657String Tff7b72= Te6edf3TYPE_INTERNALTb4b4b4,
Tff7b72val Te6edf3targetsTb4b4b4: Te6edf3ListTff7b72<Tffa657StringTff7b72>Tff7b72? Tff7b72= Tff7b72nullTb4b4b4,
Tff7b72val Te6edf3hwModelsTb4b4b4: Te6edf3ListTff7b72<Tffa657IntTff7b72>Tff7b72? Tff7b72= Tff7b72nullTb4b4b4,
Tff7b72val Te6edf3marketplaceTb4b4b4: Tffa657String? Tff7b72= Tff7b72nullTb4b4b4,
Tff7b72val Te6edf3regionsTb4b4b4: Te6edf3ListTff7b72<Tffa657StringTff7b72>Tff7b72? Tff7b72= Tff7b72nullTb4b4b4,
Tb4b4b4) Tb4b4b4{
Tff7b72companion Tff7b72object Tb4b4b4{
Tff7b72const Tff7b72val Te6edf3TYPE_INTERNAL Tff7b72= Ta5d6ff"Ta5d6ffinternalTa5d6ff"
Tff7b72const Tff7b72val Te6edf3TYPE_VENDOR Tff7b72= Ta5d6ff"Ta5d6ffvendorTa5d6ff"
Tff7b72const Tff7b72val Te6edf3TYPE_MARKETPLACE Tff7b72= Ta5d6ff"Ta5d6ffmarketplaceTa5d6ff"
Tb4b4b4}
Tb4b4b4}
T8b949e/**
* Pure mapping to the cached domain model. Callers are expected to drop [TYPE_INTERNAL] links (GitHub, YouTube, …),
* which never belong to a device's purchase section.
*/
Tff7b72fun Te6edf3NetworkDeviceLinkTb4b4b4.Td2a8fftoDeviceLinkTb4b4b4(Tb4b4b4)Tb4b4b4: Te6edf3DeviceLink Tff7b72= Te6edf3DeviceLinkTb4b4b4(
Te6edf3shortCode Tff7b72= Te6edf3shortCodeTb4b4b4,
Te6edf3description Tff7b72= Te6edf3descriptionTb4b4b4,
Te6edf3isVendor Tff7b72= Te6edf3type Tff7b72=Tff7b72= Te6edf3NetworkDeviceLinkTb4b4b4.Te6edf3TYPE_VENDORTb4b4b4,
Te6edf3regions Tff7b72= Te6edf3regionsTb4b4b4,
Te6edf3targets Tff7b72= Te6edf3targetsTb4b4b4,
Tb4b4b4)
Served by rngit 1.5.0 - Generated in 0.09s